<?php
/**
 * Created by PhpStorm.
 * User: papa
 * Date: 18/5/21
 * Time: 14:53
 */

namespace app\api\model;


class Payset extends BaseModel
{
    public static function checkCouponOpen()
    {
        $allow_coupon =  self::field('allow_coupon')->find();
        if($allow_coupon->getData('allow_coupon') == 1){
            return true;
        }else{
            return false;
        }
    }


    public static function checkFunctionOpen($field)
    {
        $value = self::field($field)->find();
        if(!$value){
            return false;
        }
        if($value->getData($field) == 1){
            return true;
        }else{
            return false;
        }
    }

}